<template>
	<view class="ql-editor">
		<scroll-view class="scroll-view_H" scroll-y="true">
			<view class="m-t-10 m-l-20 m-r-20">
				<view class="m-t-15">
					<rich-text :nodes="titleContent"></rich-text>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {
		getFunctionList
	} from "@/api/home/home.js";
	export default {
		data() {
			return {
				id: '',
				menuCode: '',
				titleContent: '',
			}
		},
		onLoad: function(res) {
			console.log(res)
			uni.setNavigationBarTitle({
				title: res.menuName || '详情'
			});
			let datas = JSON.parse(uni.getStorageSync('currentTrends'))
			this.titleContent = this.unHtmlEncode(datas) || ''
		},
		methods: {
			unHtmlEncode(handleString) {
				return handleString
					.replace(/&amp;/g, "&")
					.replace(/&lt;/g, "<")
					.replace(/&gt;/g, ">")
					.replace(/&nbsp;/g, " ")
					.replace(/&#39;/g, "\'")
					.replace(/&quot;/g, "\"");
			}
		}
	}
</script>

<style scoped lang="scss">
	page {
		height: 100%;

		.ql-editor {
			width: 100%;
			height: 100%;
			position: relative;
			background-color: #F6F7F9;

			.scroll-view_H {
				width: 100%;
				height: 100%;
				img{
					width: 100%;
					height:auto;
					display: block;
				}
			}

		}

	}
</style>
